The present invention relates to coding and decoding methods for reducing the number of bits that represent various digital signals such as an acoustic signal and an image signal and apparatuses and programs therefor, particularly, to those capable of controlling allowable distortion.
To compress audio and visual information, there are proposed an irreversible distortion-prone or lossy coding scheme, and a distortion-free or lossless coding scheme. For irreversible compression coding (or lossy compression coding), there are several well known schemes such as ITU-T (International Telecommunications Union—Telecom Standardization) and ISO/IEC MPEG (International Organization for Standardization/International Electrotechnical Commission Moving Picture Experts Group) standard schemes. With these irreversible compression coding schemes, it is possible to compress the original digital signal down to 1/10 or less with a little loss of signal data. However, the loss depends on the coding condition or the input signal, and may sometimes lead to degradation of the reconstructed signal.
On the other hand, a known reversible compression coding (or lossless compression coding) scheme capable of completely reconstructing the original signal is a universal compression coding scheme for to compressing data files and texts of computers. This compression coding scheme is able to compress any type of signals while learning the statistics of the input sequence; tests or the like can be compressed down to approximately ½, but in the case of audio and visual data, their compression ratio is only about 20%.
A combination use of high-compression-ratio irreversible coding and reversible compression of an error between the reconstructed and the original signal, flexible use either the high-compression-ratio irreversible coding or allows the reversible compression coding as required.
The inventor of the present application has proposed the above combined compression coding scheme in Japanese Patent Application Laid-Open Gazette No. 44847/01 “Coding Method, Decoding Method and Apparatuses Therefor and Recording Media Having Recorded Thereon Programs Therefor.” While described in detail in the above gazette, the combined compression coding scheme will be described below in brief with reference to FIG. 1.
In a coder 10, a digital input signal (hereinafter referred to also as an input signal sample sequence) is input via an input terminal 100, and in a frame separation part 100 the input signal sample sequence is separated into frames each consisting of, for example, 1024 input signal samples.
In an irreversible quantization part 120 the output from the frame forming part 110 is subjected to irreversible compression coding. This coding may be of any scheme suited to the digital input signal as long as it enables the input signal to be reconstructed to some extent when it is decoded. For example, when the input signal is a speech signal, ITU-T speech coding or the like can be used; in the case of music, MPEG or TwinVQ (Transform-Domain Weighted Interleaved Vector Quantization) can be used; and in the case of video, MPEG or the like can be used. Further, various irreversible quantization schemes mentioned in the above-mentioned Japanese gazette can also be employed. Incidentally, the output from the irreversible quantization part 120 will hereinafter be referred to as an “irreversibly compressed code I(n).”
In an inverse quantization part 130 of the same configuration as that of a decoding part (i.e. an inverse quantization part 230) corresponding to the irreversible quantization part 120, a locally reconstructed signal is generated from the irreversibly compressed code I(n). An error signal between the locally reconstructed signal and the original digital input signal is calculated in a subtraction part 140. Usually the amplitude of the error signal is appreciably smaller than the amplitude of the original digital input signal. Accordingly, as compared with reversibly compression coding of the digital input signal as it is, reversible compression coding of the error signal permits reduction of the amount of information.
To increase the efficiency of the reversible compression coding, a rearrangement part 160 rearranges bits of the error signal (i.e. a bit sequence or stream). The details of processing by the rearrangement part 160 will be described below with reference to FIG. 2. In the digital input signal (FIG. 2A) a positive or negative integer of each sample value (amplitude) is represented using a 2's complement format. Error signal samples between the digital input signal and the corresponding locally reconstructed signal are shown in FIG. 2B. The rearrangement part 160 converts the error signal (that is, a bit sequence) from a bit sequence of the 2's complement format to a bit sequence of a sign-magnitude format (a binary number of sign and magnitude) (FIG. 2C). In the converted error signal, MSB (Most Significant Bit) to a second LSB (Least Significant Bit) represent the magnitude of its amplitude and LSB the sign of the amplitude.
Next, in the rearrangement part 160 the error signal samples converted to the sign-magnitude format are combined at their respective corresponding bit positions (i.e., MSB, second MSB, . . . , LSB), successively in a temporal order in FIG. 2 (FIG. 2D). Each of these bit sequences (e.g., consisting of 1024 bits at the same bit position) will hereinafter be referred to as a “equi-position bit sequence.” In the above rearrangement the value of each error signal remains unchanged. Since the error signal is small in amplitude, however, high-order bits all become “0s” frequently. As a result, a sequence of “0s” provides enhanced efficiency in the reversible compression coding of the error signal.
Next, the output from the rearrangement part 160 is subjected to reversible compression coding in a reversible coding part 150. The reversible coding part 150 performs the reversible compression coding of the equi-position bit sequences by entropy coding which utilizes, for example, the presence of a consecutive sequence or a frequent-occurrence sequence, such as Huffman coding or arithmetic coding, the coded equi-position bit sequences being provided to a decoder 20. The compression efficiency will be increased as well by applying to the output from the rearrangement part 160 universal coding that reversibly compresses a text or the like.
As the result of the above processing, the coder 10 outputs the irreversibly compressed code I(n) from the irreversible quantization part 120 and the reversibly compressed code I(e) from the reversible coding part 150.
In the decoder 20 a decoding part 210 decodes the reversibly compressed code I(e). And a rearrangement part 220 sequentially outputs the error signals for each frame by performing processing reverse to that of the rearrangement part 160. The inverse quantization part 230 decodes the irreversibly compressed code I(n). An addition part 240 adds the outputs from the inverse quantization part 230 and the rearrangement part 160. Finally, a frame combining part 250 sequentially outputs the output signal from the addition part 240 to reconstruct the original input signal sample sequence, which is provided at an output terminal 260.
The conventional reversible compressing coding scheme presents a problem that when a bit erasure occurs during transmission, each sample to be reconstructed by the rearrangement part of the decoder 20 gets mixed with bits of other samples, seriously degrading the reconstructed signal quality. This prior art scheme provides a compression ratio of approximately ½ at the highest and cannot achieve a ⅓ or ¼ compression ratio with no substantial deterioration of quality nor can it implement compression with a satisfactory accuracy.
Moreover, even if the number of bits of the digital value representing the amplitude of the original signal is reduced by one bit, it is possible to restore the original waveform with the same accuracy as that with no bit reduction, but reducing four or more bits raises an auditory-sensation problem that high quantization noise is noticeable.